﻿Public Class ven_pol5

    Private Sub btnok_ven_pol5_Click(sender As Object, e As EventArgs) Handles btnok_ven_pol5.Click
        yc5 = Convert.ToSingle(txtyc5_jp5.Text)
        fp15 = Convert.ToSingle(txt_fp15.Text)
        fp25 = Convert.ToSingle(txt_fp25.Text)
        dp15 = Convert.ToSingle(txt_dp15.Text)
        dp25 = Convert.ToSingle(txt_dp25.Text)
        tetap5 = Convert.ToSingle(txt_tetap5.Text)
        decp5 = Convert.ToSingle(txt_decp5.Text)

        tetap5 = tetap5 * (3.141592 / 180)
        alfap5 = Math.Asin((dp25 - dp15) / (2 * decp5))

        fxcp5 = -Math.Cos(alfap5) * (fp15 + fp25)
        fzcp5 = Math.Sin(alfap5) * (fp15 - fp25)

        fxp5 = fxcp5 * Math.Cos(tetap5) - fzcp5 * Math.Sin(tetap5)
        fzp5 = fxcp5 * Math.Sin(tetap5) + fzcp5 * Math.Cos(tetap5)

        c5x = fxp5
        c5y = 0
        c5z = fzp5
        m5x = 0
        m5y = -(fp15 + fp25) * dp15 * 0.5
        m5z = 0

        Me.Close()
    End Sub
End Class